package com.weixin.paleituo.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.weixin.paleituo.R;
import com.weixin.paleituo.activity.GoodsStoreActivity;
import com.weixin.paleituo.base.BaseRecycleAdapter;
import com.weixin.paleituo.bean.WordOfMouthBean;
import com.weixin.paleituo.help.RecycleViewHolder;
import com.weixin.paleituo.util.UIUtils;

import java.util.List;

/**
 * Author yichao
 * Time  2018/3/28 13:54
 * Dest  口碑旺铺
 */

public class WordOfRecycycleAdapter extends BaseRecycleAdapter<WordOfMouthBean> {
    public WordOfRecycycleAdapter(Context context, List<WordOfMouthBean> datas) {
        super(context, datas, R.layout.item_wordofmouth_layout);
    }

    @Override
    protected void setData(RecycleViewHolder holder, final WordOfMouthBean wordOfMouthBean, int position) {
      ImageView imageView= holder.getItemView(R.id.iv_item_wordofmouth_layout);
        TextView tvStoreName = holder.getItemView(R.id.tv_storename_item_wordofmouth_layout);
       TextView tvMouthNumber= holder.getItemView(R.id.tv_mouth_number_item_wordofmouth_layout);
        UIUtils.loadImageView(mContext,wordOfMouthBean.getImg(),imageView);

        tvStoreName.setText(wordOfMouthBean.getStoreName()+"");
        tvMouthNumber.setText("口碑值"+wordOfMouthBean.getWordOfMouth());

        holder.mItemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                GoodsStoreActivity.startActivity(mContext,wordOfMouthBean.getStoreId());
            }
        });








    }
}
